package org.action;

import org.model.User;
import com.opensymphony.xwork2.Action;

public class LoginAction implements Action
{	
	private User user;
	
	/**
	 * 请求register!default.action，调用doDefault方法
	 */
	public String index() throws Exception
	{
		return INPUT;
	}

	@Override
	public String execute() throws Exception
	{
		if("admin".equals(user.getUsername()) && "111111".equals(user.getPassword()))
			return SUCCESS;
		else
			return ERROR;
	}

	public User getUser()
	{
		return user;
	}

	public void setUser(User user)
	{
		this.user = user;
	}
}
